from itertools import permutations


class Person:
    def __init__(self,name,sex,age,tel_money,phone,battery_capacity,screen,max_time,score):
        self.name=name
        self.sex=sex
        self.age = age
        self.tel_money=tel_money
        self.phone=phone
        self.bc=battery_capacity
        self.screen=screen
        self.max_time=max_time
        self.score=score
    def send_message(self,message):
        print("发送完成  信息内容：{}".format(message))
    def take_phone(self,tel_number,time):
        if len(tel_number)==0:
            return "拨打的电话为空号"
        elif self.tel_money < 1:
            return "余额不足"
        else:
            cost=0
            tel_score=0
            if time <=10 & time >0 & self.tel_money >= time:
                cost = time
                tel_score=time*15
            elif time>10 & time<=20 & self.tel_money >=time *0.8:
                cost = time*0.8
                tel_score=time*39
            elif time>20 & self.tel_money>= time*0.65:
                cost = time*0.65
                tel_score=time*48
            else:
                return "该通话时长花费大于话费！，无法拨打"
            self.tel_money-=cost
            self.score+=tel_score
def test():
    person1=Person("李二","男",22,5,"oppo","4500mh","6寸","48小时",0)
    person1.send_message("你好，很高兴发信息给你。")
    result=person1.take_phone("138388498830",10)
    print(result)
test()
